define(function(require, exports, module) {

	module.exports = function() {
		var params = null;
		return {
			data: {
			},
			methods: {
				init: function(data) {
					params = data;
					var _this = this;
					params.onButtonsChanged = function() {
						_this.render();
					};
					this.render();
				},
				render: function() {
					if(params.buttons.length == 0) {
						this.closeWindow();
						return;
					}
					var container = $(this.$el).find("ul.folder-menu-icons");
					$(params.buttons).each(function() {
						this.initIcon(container);
					});
				},
				destroy: function() {
					params.onButtonsChanged = function() {};
				}
			}
		}
	}

});